layui.use(['form','laypage','layer'],function(){
	
	var form = layui.form
	,layer = layui.layer
	
	initData();
	
	function initData(){
		var runId = $("#runId").val();
		ajaxPost('../caseRun/result',{runId:runId},
				function(data){
			      createData(data.data);
				},function(data){
					layer.alert(data.errorMsg,{
						icon:5,
						title:"错误"
					});
				});
	}
	
	function createData(list){
		$("#dtl").empty();
		var testResult = 1;
		for(var i = 0 ;i < list.length;i++){
			var content = [];
			var rr = list[i];
			content.push("<div style='text-align:center;margin-bottom:20px;'>");
			content.push("<span style='display:block;font-size:16px;'> 日志："+showStr(rr.log)+"</span>");
			content.push("<img  style='height:300px;width:300px' src='../"+rr.img+"' alt='图片不存在'/>");
			content.push("</div>");
			if(rr.testResult == 2)
				testResult = 2;
			$("#dtl").append(content.join(""));
		}
		
		$("#runResult").val(testResult == 1?"成功":"失败 ")
	}
	

});